<template>
  <div class="other-container">
    <van-nav-bar :title="title" left-text="返回" left-arrow @click-left="onClickBack"/>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  data() {
    return {
      title: ""
    };
  },
  methods: {
    onClickBack() {
        let that = this;
        that.$router.go(-1);
    }
  },
  beforeRouteEnter(to, from, next) {
    next(vm => {
      if (vm.activeTab == 0 && to.path == "/user") {
        vm.title = "首页";
      } else {
        vm.title = to.meta.title;
      }
    });
  }
};
</script>
<style scoped>
.other-container {
  width: 100%;
}
</style>
